package com.bing.beike.entity;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "用户实体类")  // 模型描述
public class User {
    @Schema(description = "用户ID", example = "USER_123456", required = true)
    private String id;

    @Schema(description = "用户名", example = "john_doe", required = true)
    private String username;

    @Schema(description = "真实姓名", example = "张三")
    private String realName;

    @Schema(description = "邮箱", example = "user@example.com", required = true)
    private String email;

    @Schema(description = "密码哈希值", required = true)
    private String passwordHash;

    @Schema(description = "用户角色", allowableValues = {"teacher", "student", "admin"}, required = true)
    private RoleEnum role;

    @Schema(description = "账户状态", allowableValues = {"active", "disabled"}, defaultValue = "active")
    private StatusEnum status = StatusEnum.active;

    @Schema(description = "创建时间", defaultValue = "CURRENT_TIMESTAMP")
    private LocalDateTime createdAt;


}